var express = require('express');
var StaffRouter = express.Router();
let message = require("../request_process/message");
let staffProcess =require('../request_process/staffProcess');
let email_remind =require('../request_process/email_remind');
let mission_file_upload =require('../request_process/mission_file_upload');
let code_message = require("../request_process/JsonFileOprate")
StaffRouter
    .post('/*', (req,res,next)=>{
        if(req.session.staffid) {
            next();
        }
        else{
            res.json(new  message(449,null,code_message['449']))
        }
    })
      .post('/catStaffAccount',staffProcess.catStaffAccount)
      .post('/catTodayMission',staffProcess.catTodayMission)
      .post('/catTomorrowMission',staffProcess.catTomorrowMission)
      .post('/cancelAMission',staffProcess.cancelAMission)
      .post('/catAllAssignMission',staffProcess.catAllAssignMission)
      .post('/emailRemind',email_remind.taskEmailNotification)
      .post('/modifyStaffAccount',staffProcess.modifyStaffAccount)
      .post('/finishMission',staffProcess.finishMission)
      .post('/fileupload',mission_file_upload.fileupload)
module.exports=StaffRouter

